<template>
  <div id="app1">
    <div @click="back">
      <van-nav-bar left-text="返回" left-arrow title="评论" />
     <video controls width="410">
      <source src="http://vfx.mtime.cn/Video/2019/03/19/mp4/190319212559089721.mp4" type="video/mp4" />
    </video>
   </div>
    <div v-for="item in NoticeList" :key="item.id" class="userList">
      <div class="user">
        <span class="user_ren">用户</span>
        : {{item.userName}}
        <br />用户发言:
        <span v-html="item.content" class="user_span"></span>
      </div>
    </div>
  </div>
</template>

<script>
import { Notify } from 'vant'
import Vue from 'vue'
Vue.use(Notify)
import { comit, Looked } from '@/service/movie'
import mixin from '@/mixin/flag'
export default {
  mixins: [mixin],
  props: ['list'],
  data() {
    return {
      vido: '', // 电影的播放地址
      value: '',
      id: '0', // 评论id
      NoticeList: '', // 电影评论
    }
  },

  methods: {
    async leiou() {
      var num = 0
      var numT = 10
      var resTwo = await comit({
        content: this.value,
        movieId: num++,
        score: numT++,
      })
      console.log(resTwo)
      if (resTwo.data.code == 200) {
        Notify({ type: 'success', message: '评论成功' })
        this.value = ''
      }
    },
    back() {
      this.$router.push('./indexVue')
    },
  },
  async created() {
    const res2 = await comit()
    console.log('res2', res2)
    this.NoticeList = res2.data.rows.splice(1, 10)

    const res = await Looked()
    console.log(res)
  },
}
</script>

<style lang="scss" scoped>
#app1 {
  font-size: 12px;
  line-height: 55px;
}
.dijia {
  margin-top: 10px;
  .inputV {
    vertical-align: middle;
    border: 1px solid pink;
    width: 300px;
    height: 30px;
    margin-left: 10px;
  }
  .btn {
    vertical-align: middle;
    width: 50px;
    height: 35px;
    font-size: 14px;
  }
}
.user {
  font-size: 15px;
  .user_span {
    font: 13px;
    overflow: hidden;
    font-size: 14px;
    color: #000;
    display: -webkit-box;
    -webkit-line-clamp: 2; //控制行数
    -webkit-box-orient: vertical;
    line-height: 20px;
  }
}
.user_ren {
  color: red;
}
.userList {
  flex: 1;
  border: 1px solid pink;
  margin-top: 10px;
  width: 100%;
  height: 80px;
  line-height: 15px;
  padding-top: 20px;
}
::-webkit-input-placeholder {
  /* WebKit browsers */
  color: #999;
  font-size: 18px;
}

input::-moz-placeholder {
  color: #c0c0c0;
  opacity: 1;
  font-size: 14px;
}
</style>